﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>




<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>用户登录_我要滑雪网</title>
    <meta name="description" content="用户登录" />
    <meta name="keywords" content="用户登录" />
    <meta name="robots" content="all" />
    <link href="~/Css/ski.css" type="text/css" rel="stylesheet" />
    <link href="~/Css/style_zc.css" style="text/css" rel="stylesheet" />
    <link href="~/Css/public.css" style="text/css" rel="stylesheet" />
    <link href="~/Css/about.css" style="text/css" rel="stylesheet" />

    <script src="~/Js/Mobile device_style.js"></script>
    <script src="~/Js/jqueryhelp.js"></script>
    <script type="text/javascript" src="~/Js/tab.js"></script>
    <script src="~/Js/common.js" language="javascript"></script>


</head>
<base target="_self" />
<body>

    <div class="header">
        <div class="welcome">51SKI.COM 欢迎您</div>
    </div>
    <div class="wrap_zong">
        <div class="top">
            <div class="logo"><a href="/Home/Index" target="_self"><img src="http://img.51ski.com/images/logo-x.png" /></a></div>
            <div class="search">

                <form id="searchform" name="searchform" onsubmit="newsearch()">
                    <p class="p3">
                        <span class="jiaocheng_dj">雪场</span>
                        <input type="text" name="key" value="请输入雪场关键词" id="searchkey" />            <input type="submit" value="" class="submit" />
                    </p>
                    <div class="xiaxuan">
                        <span class="xuechang">雪场</span>
                        <span class="zixun">资讯</span>
                    </div>
                </form>


                <p class="p2"><span>|</span><a href="javascript:void(0)" class="shouji">手机版</a></p>

                <p class="p1"><span id="usernamespan" style="display:none"><a id="userName" href="/Home/Snow_Users"></a></span></p>


                <p class="p1"><a href="/Home/Snow_Users_Register">注册</a><span>|</span><a id="logoutspan" href="/Home/Snow_Users"><b class="color_red">登录</b></a></p>



                <p class="p4">
                    <a href="#">教学课程</a><a href="#">戏雪</a><a href="#">滑雪</a><a href="#">单板</a><a href="#">雪票预订</a>
                </p>

            </div>
            <ul class="nav">
                <li><a href="/Home/Snow_Map">雪场地图</a></li>
                <li><a href="/Home/News_Information">新闻资讯</a></li>
                <li><a href="/Home/Snow_Activity">雪场活动</a></li>
                <li><a href="/Home/Snow_Ticket">雪票预订</a></li>
                <li><a href="/Home/Snow_Course">滑雪教程</a></li>
                <li><a href="/Home/Snow_Video">酷炫视频</a></li>
                <li><a href="/Home/Snow_Users">用户中心</a></li>
            </ul>
        </div>
        <link rel="stylesheet" type="text/css" href="~/Css/jquery-ui.min.css">
        <script src="~/Js/jsondata.js"></script>
        <script src="~/Js/auth.js"></script>
        <script src="~/Js/newsearch.js">
        </script>
        <script src="~/Js/jquery-ui.min.js"></script>
        <script>
login();
var keyval = "雪场";
$(".xiaxuan").find("span").click(function(){
   keyval=$(this).html();
   if(keyval=="资讯"){
      $("#searchkey").val("请输入搜索内容");
   }else{
      $("#searchkey").val("请输入雪场关键词");
   }
});
    $("#searchkey").autocomplete({

	// 静态的数据源
    source: htmllist,
	select: function(event, ui){
		// event参数是事件对象
		$("#searchkey").val( ui.item.label);
		// 必须阻止默认行为，因为autocomplete默认会把ui.item.value设为输入框的value值
		event.preventDefault();
	}
	});
        </script>
        <div class="bannerBox">
            <meta property="qc:admins" content="37756746706513316375" />
            <meta property="wb:webmaster" content="fb819aca50abdc07" />
            <div class="center dl_center">
                <div class="dl_zuoce"><img src="http://img.51ski.com/images/zhuti_bg_01.gif" alt="用户登录" /></div>
                <div class="zc_content">
                    <div class="zc_content_top">
                        <span class="sp1">登录</span><span class="tu_b"></span><span class="sp3">去 <a href="http://www.51ski.com/register"> 注册></a></span>
                    </div>
                    <form id="form1">
                        <input type="text" placeholder="邮箱/手机/用户名" id="usernamehelp" class="box" />
                        <input type="password" placeholder="请输入用户密码" id="password" class="box password" />
                        <input type="checkbox" name="fuxuan" id="fuxuan" />
                        <label for="fuxuan">记住我的登录状态</label>
                        <div class="a_wrap"><a href="http://www.51ski.com/forget">忘记密码</a><a href="#" onclick="return toregister()">&nbsp;&nbsp;&nbsp;快捷注册</a></div>
                        <input type="button" value="登录" onclick="show()" class="btn" />
                    </form>
                    <p class="p2">第三方账户登录</p>
                    <p class="p3"><a><span class="wx" onclick="weixinlogin()">微信</span></a><a><span class="xl" onclick="sinalogin()">新浪微博</span></a><a><span class="qq" onclick="qqlogin()">QQ登录</span></a></p>
                </div>
                <div style="clear:both"></div>
            </div>


            <script>

var request ={QueryString : function(val){
var uri = window.location.search;var re = new RegExp("" +val+ "=([^&?]*)", "ig");
return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
}
}
var reurl;
try{
reurl = request.QueryString("reurl");
}catch(e){
}

function weixinlogin(){
 getData("http://admin.51ski.com/api/goweixin/weixinLogin.do", {}, function(result){
                      //  alert(result.url);

                         window.location.target='_top';
			window.location.href = result.url;
	 	});

}
function qqlogin(){
 getData("http://admin.51ski.com/api/qq/qqLogin.do", {}, function(result){
                      //  alert(result.url);

                         window.location.target='_top';
			window.location.href = result.url;
	 	});

}
function sinalogin(){
 getData("http://admin.51ski.com/api/sina/sinaLogin.do", {}, function(result){
                      //  alert(result.url);

                         window.location.target='_top';
			window.location.href = result.url;
	 	});

}

function show(){


if(!check()){
 return;
}
//alert($('#usernamehelp').val());
//alert($('#password').val());

getData("http://admin.51ski.com/mlogin/login.do", {
					"username": $('#usernamehelp').val(),
					"password": $('#password').val()
				}, function(result) {
				    if(!result.success){
					alert(result.failedReason);
					}else{
					//alert('登录成功');
					  if($("input[name='fuxuan']:checked").length>0){
						    setCookie("userId",result.object.id);
						    setCookie("userName",result.object.username);						             setCookie("nickName",result.object.nickname);
						}else{
						    setCookie("userId",result.object.id,10);
						    setCookie("userName",result.object.username,10);
setCookie("nickName",result.object.nickname,10);
						}
window.location = reurl;					}
				});
}


function check(){
 var username=$.trim($('#usernamehelp').val());
 var password=$.trim($('#password').val());
  if(username== '') {
    alert('请输入用户名');
    return false;
  }
  if(password== '') {
    alert('请输入密码');
    return false;
  }


 return true;
}

function fastlogin(){

   var username=$.trim($('#phoneuser').val());

  if(username== '') {
    alert('请输入手机号');
    return ;
  }
 if(!validatemobile(username)){
     alert('请输入正确的手机号码');
      return ;
   }


   getData("http://admin.51ski.com/app/register/index.do", {
					username: $('#phoneuser').val()				}, function(result) {

				    if(!result.success){
					alert(result.failedReason);
					}else{
                                    alert('注册短信稍后收到请查看手机取得密码');
                            }
		});

 $(".change_label").remove();
}
function toregister(){
$(".change_label").remove();
 $("body").append("<div class='change_label'><p class='p1'><i>X</i></p><p><span>手机号：</span><input id='phoneuser' type='text' /></p><p class='gq_btn'><button onclick='fastlogin()'>注册</button></p></div>");
  $(".change_label").append("")
	$('.change_label').css({
		position:'absolute',
		left: ($(window).width() - $('.change_label').outerWidth())/2,
		top: ($(window).height() - $('.change_label').outerHeight())/2 + $(document).scrollTop()
		}).show("fast");
$(".change_label .p1 i").click(function(){
$(".change_label").remove();
});
return false;
}

function validatemobile(mobile)
   {

       if(mobile.length!=11)
       {
          // alert('请输入有效的手机号码！');

           return false;
       }

       var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
       if(!myreg.test(mobile))
       {
          // alert('请输入有效的手机号码！');

           return false;
       }
       return true;
   }

            </script>
        </div>
        <div class="zx_footer">

            <ul>
                <li>
                    <img src="http://img.51ski.com/images/weibo_tuo1.png" />
                    <input type="button" value="进入官方微博" onclick="window.open('http://weibo.com/51ski/profile?s=6cm7D0')" />
                </li>
                <li>
                    <img src="http://img.51ski.com/images/weixin_tuo1.png" />
                    <input type="button" value="扫一扫立即注册" />
                </li>
            </ul>
            <div class="erweima">
                <img src="http://img.51ski.com/images/erweima.png" />
            </div>
            <div class="foot_con">
                <p><a href="http://www.51ski.com/aboutus/">关于我们</a><span>|</span><a href="http://www.51ski.com/law/">法律声明</a><span>|</span><a href="http://www.51ski.com/joinus/">加入我们</a><span>|</span><a href="http://www.51ski.com/coop/">合作雪场</a><span>|</span><a href="http://www.51ski.com/connection/">联系我们</a></p>
                <p>&copy;Copyright    1996-2014 51SKI  Corporation, All Rights Reserved</p>
                <p><a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action">51SKI 京公网安备11010102001739号/京ICP备15016851号-4</a></p>
                <p>我要滑雪网   版权所有 </p>
            </div>

        </div>
        <script type="text/javascript">
try{
var _ourplusPageurl = top.location.href;
}catch(e)
{
var _ourplusPageurl = location.href;
}
document.getElementById("logoutspan").href = "http://www.51ski.com/login/index.html?reurl=" + _ourplusPageurl;
        </script>
        <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?3bbc0e16ff36039bc4d0e85091a39c71";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
        </script>

    </div>
</body>

</html>
